﻿
<h2 class="title">Уреди корисник</h2>
<?php echo form_open_multipart('adminUsers/processUser/'.$user->idUserPk); ?>
<table>
	<tr>
		<td>Корисничко име:</td>
		<td><input type="text" name="username" id="username" value="<?= $user->username ?>" /></td>
	</tr>
	<tr>
		<td>Лозинка:</td>
		<td><input type="text" name="password" id="password" value="<?= $user->password ?>" /></td>
	</tr>
	<tr>
		<td>E-mail:</td>
		<td><input type="text" name="email" id="email" value="<?= $user->email ?>" /></td>
	</tr>
	<tr>
		<td>Улога:</td>
		<td><select id="role" name="role">
			<?php 
				foreach($roles as $role){
					$selected = '';
					if($user->role == $role->idRlsPk) $selected = 'selected';
					echo "<option value='".$role->idRlsPk."' ".$selected." >".$role->name."</option>";
					};
			?>
		</select></td>
	</tr>
	<tr>
		<td>Кориснички профил:</td>
		<td><select id="staffProfile" name="staffProfile">
			<option value="">--</option>
			<?php 
				foreach($profiles as $profile){
						$selected = '';
						if($user->staffProfile == $profile->idStaffFk) $selected = 'selected';
							echo "<option value='".$profile->idStaffFk."' ".$selected.">".$profile->name." ".$profile->surname."</option>";
						}
			?>
		</select></td>
	</tr>
	<tr>
		<td><input type="hidden" name="tip" id="tip" value="2" /></td>
		<td><input type="submit" name="submit" id="submit" value="Внеси" /></td>
	</tr>
</table>
<?php echo form_close(); ?>